#!/bin/bash
#./monitor.sh
tcpdump -i ath0 -l -s 0 -e  'link[0] != 0x80' |awk \
'$22 == "Acknowledgment" && $19 == "RA:00:80:48:57:ca:4e" {printf("%s \tCal --> Ath %s %s\n<<<_____________\n",$22,$6,$7);}; \
$22 == "Acknowledgment" && $19 == "RA:00:00:10:01:02:01" {printf("%s \tCal <-- Ath %s %s\n_____________>>>\n",$22,$6,$7);}; \
$22 == "Clear-To-Send" && $19 == "RA:00:80:48:57:ca:4e" {printf("%s \tCal --> Ath %s %s\n",$22,$6,$7);}; \
$22 == "Clear-To-Send" && $19 == "RA:00:00:10:01:02:01" {printf("%s \tCal <-- Ath %s %s\n",$22,$6,$7);}; \
$25 == "Request-To-Send" && $19 == "RA:00:00:10:01:02:01" {printf("%s Cal <-- Ath %s %s\n",$25,$6,$7);};\
$25 == "Request-To-Send" && $19 == "RA:00:80:48:57:ca:4e" {printf("%s Cal --> Ath %s %s\n",$25,$6,$7);};\
$45 == "10.1.2.1" {printf("ICMP %s \tCal --> Ath %s %s\n",$50,$6,$7);};\
$45 == "10.1.2.31" {printf("ICMP %s \tCal <-- Ath %s %s\n",$50,$6,$7);};'

